
/************************************************************/
/*  Author:			Michael Mozdzierz						*/
/*	Date:			02/05/2015								*/
/*	Description:	An object that represents a texture cube*/
/*					in the direct x API						*/
/*															*/
/************************************************************/

#pragma once

#include "IGrahpicsResource.h"
#include <D3D11.h>

class TextureCube : public IGraphicsResource
{
	ID3D11Texture2D* texture = nullptr;

	ID3D11ShaderResourceView* srv = nullptr;
public:
	TextureCube(ID3D11Texture2D* texture, ID3D11ShaderResourceView* srv);
	virtual ~TextureCube(void);

	// copies data in video memory to CPU memory
	virtual void getData(void* data, unsigned int pixelStride) override;
	// copies resource data in CPU memory to video memory
	virtual void setData(void* data, unsigned int pixelStride) override;

	// gets the d3d11 object that represents the resource
	virtual ID3D11Resource* getResource(void) const { return (ID3D11Resource*)texture; }
	// gets shader resource view for this resource
	virtual ID3D11ShaderResourceView* getSrv(void) const { return srv; }

	// gets the d3d11 descriptor for this object and copies it onto 'desc'
	virtual void getDesc(void* desc) override;
};